package com.awx.client.entities;

import java.io.Serializable;



public abstract class Entity implements Serializable{
	
	protected Long id = 0L;
	
	public Entity() {
		
	}
	/**
	 * Devuelve 0 si el objeto no esta persistido
	 */
	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}
	
	@Override
	public boolean equals(Object obj) {
		return this.getClass().isInstance(obj) && !this.getId().equals(0L) 
					&& Entity.class.cast(obj).getId().equals(this.getId());
	}
	
	
}
